#pragma once
#include "IBasicRenderObject.h"

namespace BasicSkinView
{
	class IBasicSkinRenderStatic:public BasicSkinView::IBasicSkinRenderObject
	{
	public:
		IBasicSkinRenderStatic();
		virtual ~IBasicSkinRenderStatic();
	public:
		static IBasicSkinRenderStatic* CreateRenderStatic(COLORREF clr = 0);
	public:
		virtual void OnRenderObject(CBasicSkinCanvas* pCanvas,RECT* prc);
		virtual void OnRenderText(CBasicSkinCanvas* pCanvas,RECT* prc,const wchar_t* szText);
	public:
		void SetRenderText(const wchar_t* sz);
		void SetTextColor(COLORREF clr);
		void SetFormat(Gdiplus::StringFormat* pFormat,bool bDel);
		void SetFont(Gdiplus::Font* pFont,bool bDel);
		void SetFormat(UINT uFormat);
	public:
		wstring	m_strText;
		COLORREF m_clrText;

		Gdiplus::Font*				m_pFont;
		Gdiplus::StringFormat*		m_pFormat;
		bool						m_bDelFont;
		bool						m_bDelFormat;
	};
}

/*
	demo

	IBasicSkinRenderImage		m_renderImage;
	IBasicSkinRenderStatic		m_renderText;

	void CBasicSkinButton::BsOnRenderView(CBasicSkinCanvas* pCanvas)
	{
		RECT rc;
		this->BsGetClientRect(&rc);
		int nStatus = GetButtonRenderStatus();
		
		m_renderImage.SetCurIndex(nStatus);
		
		COLORREF clr = m_renderText.m_clrText;
		if (nStatus == 3)
			clr = RGB(60,60,60);

		m_renderText.SetTextColor(clr);
		m_renderImage.OnRenderObject(pCanvas,&rc);
		if (m_strText.length())
			m_renderText.OnRenderText(pCanvas,&rc,m_strText.c_str());
		m_renderText.m_clrText = clr;
	}
*/